Specificity

Specificity in CSS#

as you know in CSS before apply any properties you have to select the element, to select elements you have many methods like select by id, class, tagName, attributes or we can style it directly by inline style, but if you have selected the element from two places and you have changed the color of the element in both places which one will apply? like :

index.html

final result

index.css

final result

Final Result

final result

so why css applied the second one?, because select by id is stronger than select by class.

Comprehensive Image#

final result